<?php /* Smarty version 2.6.20, created on 2016-07-20 15:28:16
         compiled from order_edit.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'order_edit.htm', 24, false),array('modifier', 'number_format', 'order_edit.htm', 67, false),)), $this); ?>
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['config']['weburl']; ?>
/script/jquery.ui.js"></script>
<div class="container">
<div class="oflow" style="height:545px">
<form name="form1" id="form1" action="module.php?m=product&s=order_opear.php" method="post">
<input name="id" type="hidden" id="id" value="<?php echo $this->_tpl_vars['de']['order_id']; ?>
">
<input type="hidden" name="money" value="<?php echo $this->_tpl_vars['de']['cost']; ?>
" />
<table class="table">
    <thead>
        <tr>
            <th class="partition" colspan="99">订单详情</th>
        </tr>
    </thead>
    <tbody>
    <tr class="tr">
        <td width="50">订单状态</td>
        <td width="100"><b class="org"><?php echo $this->_tpl_vars['de']['statu_text']; ?>
</b></td>
    
        <td width="50">订单编号</td>
        <td width="150"><?php echo $this->_tpl_vars['de']['order_id']; ?>
</td>
        
        <td width="50">下单时间</td>
        <td width="150"><?php echo ((is_array($_tmp=$this->_tpl_vars['de']['create_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d&nbsp;%H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d&nbsp;%H:%M:%S")); ?>
</td>
    </tr>
    <tr class="tr">
        <td>支付状态</td>
        <td><?php echo $this->_tpl_vars['de']['order_ship_status']; ?>
</td>
		
        <td>配送状态</td>
        <td width="100"><?php echo $this->_tpl_vars['de']['order_pay_status']; ?>
</td>
		
		<td width="50">下单平台</td>
		<td width="50"><?php echo $this->_tpl_vars['client_platform'][$this->_tpl_vars['de']['client_platform']]; ?>
</td>
		
		<td width="50">操作系统</td>
		<td><?php echo $this->_tpl_vars['client_system'][$this->_tpl_vars['de']['client_system']]; ?>
</td>
    </tr>
    </tbody>
</table>
<table class="table product">    
    <thead>
        <tr>
            <th class="partition" colspan="99">订单信息</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="al">编号</td>
			<td width="100">产品ID</td>
			<td width="60">产品图</td>
            <td class="al">产品</td>
            <td width="90">单价</td>
            <td width="90">数量</td>
            <td width="90">总价</td>
        </tr>
        <?php $_from = $this->_tpl_vars['de']['product']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
        <tr>
            <td class="al"><?php echo $this->_tpl_vars['list']['code']; ?>
</td>
			<td><?php echo $this->_tpl_vars['list']['pid']; ?>
</td>
			<td width="50"><a href="<?php echo $this->_tpl_vars['list']['pic']; ?>
" target="_blank"><img width="50" height="50" src="<?php echo $this->_tpl_vars['list']['pic']; ?>
" onmouseover="javascript:showOriginImg('<?php echo $this->_tpl_vars['list']['pic']; ?>
');" onmouseout="javascript:hideOriginImg();"/></a></td>
            <td class="al <?php if ($this->_tpl_vars['list']['service']): ?>npb<?php endif; ?>">
                <a target="_blank" href="http://www.haioo.com/item-<?php echo $this->_tpl_vars['list']['pid']; ?>
.html">
                    <?php echo $this->_tpl_vars['list']['name']; ?>

                </a>
            </td>
            <td <?php if ($this->_tpl_vars['list']['service']): ?>class="npb"<?php endif; ?>><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td>
            <td <?php if ($this->_tpl_vars['list']['service']): ?>rowspan="2"<?php endif; ?>><?php echo $this->_tpl_vars['list']['num']; ?>
</td>
            <td <?php if ($this->_tpl_vars['list']['service']): ?>rowspan="2"<?php endif; ?>><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['list']['sum'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
</td>
        </tr>
        <?php if ($this->_tpl_vars['list']['product_give']): ?>
        <tr class="product_give">
            <td class="al">赠品</td>
            <td class="al">
                <?php $_from = $this->_tpl_vars['list']['product_give']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['slist']):
?>
                    <li><?php echo $this->_tpl_vars['slist']['pname']; ?>
</li>
                <?php endforeach; endif; unset($_from); ?>
            </td>
        </tr>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['list']['service']): ?>
        <tr class="other">
            <td class="al">服务</td>
            <td class="al">
                <?php $_from = $this->_tpl_vars['list']['service']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['slist']):
?>
                    <li><?php echo $this->_tpl_vars['slist']['name']; ?>
</li>
                <?php endforeach; endif; unset($_from); ?>
            </td>
            <td>
                <?php $_from = $this->_tpl_vars['list']['service']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['slist']):
?>
                    <p><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['slist']['price']; ?>
</p>
                <?php endforeach; endif; unset($_from); ?>
            </td>
        </tr>
        <?php endif; ?>
        <?php endforeach; endif; unset($_from); ?>
        <?php if ($this->_tpl_vars['de']['des']): ?>
        <tr>
            <td class="al" colspan="99">备注: <?php echo $this->_tpl_vars['de']['des']; ?>
</td>
        </tr>
        <?php endif; ?>
    </tbody>
	<div id="productImgDetail" align="center" style="position:fixed;top:19%;left:14%;display:none;"><img width="240" height="240" src="" onerror="this.src='../image/admin/sns_img_fail_min.jpg'" /></div>
</table>
<table class="table">
    <tbody>
    <?php if ($this->_tpl_vars['de']['status'] == 1 && $this->_tpl_vars['de']['pay_status'] == 1): ?>
    <tr>
        <td width="100">商品总金额:</td>
        <td width="200">
        <input type="text" name="cost" id="cost" readonly value="<?php echo $this->_tpl_vars['de']['cost']; ?>
" />
        </td>
        <td width="100">配送方式：</td>
        <td>
            <select name="shipping_id" class="w162">
            <?php $_from = $this->_tpl_vars['ship']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                <option <?php if ($this->_tpl_vars['de']['shipping_id'] == $this->_tpl_vars['list']['id']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['id']; ?>
"><?php echo $this->_tpl_vars['list']['title']; ?>
</option>
            <?php endforeach; endif; unset($_from); ?>
            </select>
        </td>
    </tr>
    <tr>
        <td>配送费用:</td>
        <td><input type="text" id="freight" name="freight" value="<?php echo $this->_tpl_vars['de']['freight']; ?>
" readonly/></td>
        <td>支付方式：</td>
        <td>
        <select name="payment_id" class="w162">
        <?php $_from = $this->_tpl_vars['pay']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
            <option <?php if ($this->_tpl_vars['de']['payment_id'] == $this->_tpl_vars['list']['payment_id']): ?>selected="selected"<?php else: ?>disabled="disabled"<?php endif; ?> value="<?php echo $this->_tpl_vars['list']['payment_id']; ?>
"><?php echo $this->_tpl_vars['list']['payment_name']; ?>
</option>
        <?php endforeach; endif; unset($_from); ?>
        </select>
        </td>
    </tr>
    <tr>
        <td>商品重量:</td>
        <td><input type="text" name="weight" value="<?php echo $this->_tpl_vars['de']['weight']; ?>
" readonly/></td>
<!--         <td>订单折扣或涨价：</td>
        <td>
        <input type="text" name="rebate" id="rebate" value="" class="w160" oninput="javascript:inputBuynum(this);" />
        <span class="hint">输入"-100","100"</span>
        </td> -->
        <td>余额支付:</td>
        <td><input type="text" name="cash_price" id="cash_price" readonly value="<?php echo ((is_array($_tmp=$this->_tpl_vars['de']['cash_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
" /></td>    	
    </tr>
    <tr>
		<td>活动优惠:</td>
		<td><input type="text" name="discount" id="discount" readonly value="<?php echo ((is_array($_tmp=$this->_tpl_vars['de']['discount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
" /></td>
        <td>优惠券:</td>
        <td><input type="text" name="cpns_price" id="cpns_price" readonly value="<?php echo ((is_array($_tmp=$this->_tpl_vars['de']['cpns_price'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
" /></td>
    </tr>
    <tr>
        <td>行邮税:</td>
        <td><input type="text" name="tax_price" id="tax_price" value="<?php echo $this->_tpl_vars['de']['tax_price']; ?>
" readonly></td>
        <td>保险费:</td>
        <td><input type="text" name="insurance_fee" id="insurance_fee" value="<?php echo $this->_tpl_vars['de']['insurance_fee']; ?>
" readonly></td>
    </tr>
    <tr>
        <td>应付总额:</td>
        <td colspan='3'><input type="text" name="price" id="price" readonly value="<?php echo ((is_array($_tmp=$this->_tpl_vars['de']['cost']+$this->_tpl_vars['de']['freight']+$this->_tpl_vars['de']['tax_price']-$this->_tpl_vars['de']['cash_price']-$this->_tpl_vars['de']['cpns_price']-$this->_tpl_vars['de']['discount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, 2) : number_format($_tmp, 2)); ?>
" /></td>
    </tr>
	<?php else: ?>
    <tr>
        <td width="100">商品总金额:</td>
        <td width="200"><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['cost']; ?>
</td>
        <td width="100">配送方式：</td>
        <td><?php echo $this->_tpl_vars['de']['shipping_name']; ?>
</td>
    </tr>
    <tr>
        <td>配送费用:</td>
        <td><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['freight']; ?>
</td>
        <td>支付方式：</td>
        <td><?php echo $this->_tpl_vars['de']['payment_name']; ?>
</td>
    </tr>
    <tr>
        <td>商品重量:</td>
        <td><?php echo $this->_tpl_vars['de']['weight']; ?>
kg</td>
        <td>余额支付:</td>
        <td>-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['cash_price']; ?>
</td>    
    </tr>
    <tr>
        <td>优惠券:</td>
        <td>-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['cpns_price']; ?>
</td>    
        <td>活动优惠:</td>
        <td>-<?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['discount']; ?>
</td>
    </tr>    
    <tr>
        <td>行邮税:</td>
        <td><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['tax_price']; ?>
</td>
        <td>保险费:</td>
        <td><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['insurance_fee']; ?>
</td>
    </tr>
    <tr>
        <td>应付总额:</td>
        <td colspan='3'><?php echo $this->_tpl_vars['config']['money']; ?>
<?php echo $this->_tpl_vars['de']['cost']+$this->_tpl_vars['de']['freight']+$this->_tpl_vars['de']['tax_price']-$this->_tpl_vars['de']['cash_price']-$this->_tpl_vars['de']['cpns_price']-$this->_tpl_vars['de']['discount']; ?>
</td>
    </tr>
    <?php endif; ?>
    </tbody>
</table>
<table class="table">         
    <thead>
    <tr>
        <th class="partition" colspan="99">收货地址</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td width="100">收货人</td>
        <td><input type="text" name="ship_name" class="w350" value="<?php echo $this->_tpl_vars['de']['ship_name']; ?>
" /></td>
    </tr>
    <tr>
        <td>邮编</td>
        <td>
        <input type="text" name="ship_zip" class="w350" value="<?php echo $this->_tpl_vars['de']['ship_zip']; ?>
" />
        </td>
    </tr>
    <tr>
        <td>手机</td>
        <td>
        <input type="text" name="ship_mobile" class="w350" value="<?php echo $this->_tpl_vars['de']['ship_mobile']; ?>
" />
        </td>
    </tr>
	    <tr>
        <td>身份证号</td>
        <td>
        <input type="text" name="shipping_idcard" class="w350" value="<?php echo $this->_tpl_vars['de']['shipping_idcard']; ?>
" />
        </td>
    </tr>
    <tr>
        <td>收货地址</td>
        <td><input type="text" name="ship_addr" class="w350" value="<?php echo $this->_tpl_vars['de']['ship_addr']; ?>
" /></td>
    </tr>
<!--     
    <tr>
        <td width="100">收货人</td>
        <td><?php echo $this->_tpl_vars['de']['ship_name']; ?>
</td>
    </tr>
    <tr>
        <td>联系电话</td>
        <td><?php echo $this->_tpl_vars['de']['ship_mobile']; ?>
 <?php echo $this->_tpl_vars['de']['ship_tel']; ?>
</td>
    </tr>
	<tr>
        <td>身份证号</td>
        <td><?php echo $this->_tpl_vars['de']['shipping_idcard']; ?>
</td>
    </tr>
    <tr>
        <td>邮编</td>
        <td><?php echo $this->_tpl_vars['de']['ship_zip']; ?>
</td>
    </tr>
    <tr>
        <td>收货地址</td>
        <td><?php echo $this->_tpl_vars['de']['ship_addr']; ?>
</td>
    </tr>
        -->
    </tbody>
</table>
<div style="margin:20px auto;"></div>
<!--<table class="table">         
    <thead>
        <tr>
            <th class="partition" colspan="99">发票信息</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td width="100">发票信息</td>
            <td><?php $_from = $this->_tpl_vars['lang']['itype']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['v']):
?><?php if ($this->_tpl_vars['num'] == $this->_tpl_vars['de']['invoices']['type']): ?><?php echo $this->_tpl_vars['v']; ?>
<?php endif; ?><?php endforeach; endif; unset($_from); ?></td>
        </tr>
        <?php if ($this->_tpl_vars['de']['invoices']['type'] == 1): ?>
        <tr>
            <td>单位名称</td>
            <td><?php echo $this->_tpl_vars['de']['invoices']['company']; ?>
</td>
        </tr>
        <tr>
            <td>纳税人识别号</td>
            <td><?php echo $this->_tpl_vars['de']['invoices']['number']; ?>
</td>
        </tr>
        <tr>
            <td>注册地址</td>
            <td><?php echo $this->_tpl_vars['de']['invoices']['address']; ?>
</td>
        </tr>
        <tr>
            <td>注册电话</td>
            <td><?php echo $this->_tpl_vars['de']['invoices']['telephone']; ?>
</td>
        </tr>
        <tr>
            <td>开户银行</td>
            <td><?php echo $this->_tpl_vars['de']['invoices']['bank']; ?>
</td>
        </tr>
        <tr>
            <td>银行帐户</td>
            <td><?php echo $this->_tpl_vars['de']['invoices']['account']; ?>
</td>
        </tr>
        <?php else: ?>
        <tr>
            <td>发票抬头</td>
            <td><?php $_from = $this->_tpl_vars['lang']['irise']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['v']):
?><?php if ($this->_tpl_vars['num'] == $this->_tpl_vars['de']['invoices']['rise']): ?><?php echo $this->_tpl_vars['v']; ?>
<?php endif; ?><?php endforeach; endif; unset($_from); ?><?php if ($this->_tpl_vars['de']['invoices']['rise'] == 1): ?><?php echo $this->_tpl_vars['de']['invoices']['company']; ?>
<?php endif; ?></td>
        </tr>
        <?php endif; ?>
        <tr>
            <td>发票内容</td>
            <td><?php $_from = $this->_tpl_vars['lang']['icontent']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['v']):
?><?php if ($this->_tpl_vars['num'] == $this->_tpl_vars['de']['invoices']['content']): ?><?php echo $this->_tpl_vars['v']; ?>
<?php endif; ?><?php endforeach; endif; unset($_from); ?></td>
        </tr>
    </tbody>
</table>-->
<div class="dialog_button">
<input id="save" type="button" value="保存">
<input name="act" type="hidden" id="action" value="edit">   
</div>
<div id="error"></div> 
<script>
//展示产品图片原图
function showOriginImg(src){
    var productImgDetail = $("#productImgDetail");
    productImgDetail.find('img').attr('src',src+"/560"); 
    productImgDetail.show();
}
//隐藏产品图片原图
function hideOriginImg(){
    $("#productImgDetail").hide();
}
function count()
{
	var cost=Number($("#cost").val()).toFixed(2);
	var freight=0-Number($("#freight").val()).toFixed(2);
	var cpns_price = Number($("#cpns_price").val()).toFixed(2);
	var discount = Number($("#discount").val()).toFixed(2);
	var cash_price = Number($("#cash_price").val()).toFixed(2);
	var tax_price = 0-Number($("#tax_price").val()).toFixed(2);
	var rebate=Number($("#rebate").val()).toFixed(2);
	var price=cost-freight-tax_price-cpns_price-discount-cash_price;
	if(price>0){
		$("#price").val(price);
	}
}
function inputBuynum(ele){
	var buyNum = $(ele).val();
	var num = $("#price").val()*-1;
	if(buyNum!=null&&buyNum!=""){
		if(Number(buyNum)<Number(num)){
			alert("输入的数量有误");
			$(ele).val('0');
			count();
		}
	}
} 
function $$(id) {
	return !id ? null : document.getElementById(id);
}
function ajaxpost(formid) {
	var ajaxframeid = 'ajaxframe';
	var ajaxframe = $$(ajaxframeid);
	if(!ajaxframe){
		var div = document.createElement('div');
		div.style.display = 'none';
		div.innerHTML = '<iframe name="' + ajaxframeid + '" id="' + ajaxframeid + '" loading="1"></iframe>';
		ajaxframe = $$(ajaxframeid);
		$$('append_parent').appendChild(div);
	}
	$$(formid).target = ajaxframeid;
	$$(formid).submit();
	window.parent.main.document.location.reload();
	DialogManager.close("order");
}
$("#save").click(function () {
	ajaxpost("form1");
	return false;
});
</script>
</form>
</div>
</div>